function userresponse(data) {

	var user_name = data.get("get_owner").getData().getDisplayName()
	var user_id = data.get("get_owner").getData().getId();
	var viewer_id = data.get("get_viewer").getData().getId();
	var user_thumbnail = data.get("get_owner").getData().getField(opensocial.Person.Field.THUMBNAIL_URL);
	if(user_id != viewer_id){
		top.location.href="http://www.orkut.com.br/Main#AppInfo?appId=55061156264";
	}
	var viewerFriends = data.get('get_friends').getData();
	
	if(viewerFriends != ""){
		var friendstr = ''; 
		viewerFriends.each(function(Friends) {
		    friendstr += "'"+Friends.getId()+"',";
		});
		var len = friendstr.length;
		friendstr = friendstr.substr(0,len-1);
	}
	
	$("#user_friend").attr("value",friendstr);
	$("#user_name").attr("value",user_name);
	$("#user_id").attr("value",user_id);
	$("#user_thumbnail").attr("value",user_thumbnail);
	
	var data = {};
	data.user_name = user_name;
	data.user_id = user_id;
	data.user_thumbnail = user_thumbnail;
	data.user_friend = friendstr;
	makePOSTRequest('userinit','farm','index',data);
};
function getuserinfo() {
  var idspec = opensocial.newIdSpec({"userId":"VIEWER", "userId" : "OWNER", "groupId" : "FRIENDS" });
  var req = opensocial.newDataRequest();
  var params = {
    "max" : 30
  };
  req.add(req.newFetchPersonRequest("OWNER"), "get_owner");
  req.add(req.newFetchPersonRequest("VIEWER"), "get_viewer");
  req.add(req.newFetchPeopleRequest(idspec,params), "get_friends");
  req.send(userresponse);
};